from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
_magic_number = 2
_modified_time = 1212611965.833776
_template_filename='/home/andi/devel/python/pylons/votafam-ng/votafam/votafam/templates/index.mako'
_template_uri='/index.mako'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
_exports = []


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, '/poll.mako', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack.push_frame()
    try:
        __M_locals = dict(pageargs=pageargs)
        h = context.get('h', UNDEFINED)
        c = context.get('c', UNDEFINED)
        # SOURCE LINE 2
        context.write(u'\n')
        # SOURCE LINE 3
        if c.message_alert:
            # SOURCE LINE 4
            context.write(u'<span>')
            context.write(unicode(c.message_alert))
            context.write(u'</span>\n')
        # SOURCE LINE 6
        context.write(u'\n<table width="100%">\n  <tbody>\n')
        # SOURCE LINE 9
        if c.list:
            # SOURCE LINE 10
            context.write(u'    ')
 
            col_count = 0
            MAX_COLS = 2 
            
            
            __M_locals.update(dict([(__M_key, locals()[__M_key]) for __M_key in ['MAX_COLS','col_count'] if __M_key in locals()]))
            # SOURCE LINE 13
            context.write(u'\n')
            # SOURCE LINE 14
            for row in c.list:
                # SOURCE LINE 15
                context.write(u'        ')
                col_count += 1 
                
                __M_locals.update(dict([(__M_key, locals()[__M_key]) for __M_key in [] if __M_key in locals()]))
                context.write(u'\n')
                # SOURCE LINE 16
                if col_count == 1:
                    # SOURCE LINE 17
                    context.write(u'    <tr>\n')
                # SOURCE LINE 19
                context.write(u'      <td align="center"><a href="')
                context.write(unicode(h.url_for(action='vote',id=row.cdcandidato)))
                context.write(u'">')
                context.write(unicode(h.image_tag(''.join(['/imagens/poll/',str(row.r_candidato.idcandidato),'.jpg']),border=0, alt=row.r_candidato.nmcandidato,title=row.r_candidato.nmcandidato)))
                context.write(u'</a><br/>')
                context.write(unicode(row.r_candidato.nmcandidato))
                context.write(u'</td>        \n')
                # SOURCE LINE 20
                if col_count == MAX_COLS:
                    # SOURCE LINE 21
                    context.write(u'            ')
                    col_count = 0 
                    
                    __M_locals.update(dict([(__M_key, locals()[__M_key]) for __M_key in ['col_count'] if __M_key in locals()]))
                    context.write(u'\n    </tr>\n')
            # SOURCE LINE 25
            if col_count < MAX_COLS and col_count > 0:
                # SOURCE LINE 26
                for i in range(col_count):
                    # SOURCE LINE 27
                    context.write(u'      <td>&nbsp;</td>\n')
                # SOURCE LINE 29
                context.write(u'    </tr>\n')
        # SOURCE LINE 32
        context.write(u'  </tbody>\n</table>')
        return ''
    finally:
        context.caller_stack.pop_frame()


